import { onMounted, ref } from 'vue';

export function useItemWidth() {
  const itemWidth = ref(0);
  const setWidth = () => (itemWidth.value = (window.innerWidth - 32) / 2);
  onMounted(setWidth);
  window.onresize = setWidth;

  return itemWidth;
}
